<?php
    
class TeamPoint extends DataObject {
	static $db = array(
		"Points" => "Int",
	    "GoalsShot" => "Int",
	    "GoalsRecieved" => "Int",
	    "Rank" => "Int",
	    "PlayedGames" => "Int",
	    "Wins" => "Int",
	    "Draws" => "Int",
	    "Defeats" => "Int",
	    "FairplayPoints" => "Int",
	    "FoulPoints" => "Int",
	    "FairPlayFoulPoints" => "Int"   
	);
	
	static $has_one = array (
	   'Team' => 'Team',
	   'League' => 'League'
	);
	
	public function GoalsDifference() {
		return $this->GoalsShot - $this->GoalsRecieved;
	}
 
}


?>